					<?php
					 $totalColumn = count($fields[DATA]);
					 forEach($record as $rec){ ?>
					
					 <?php
					 	for($x=0;$x<count($fields[DATA]);$x++)
				     	 	echo "<td>" . $rec[ $fields[DATA][$x][FIELDS] ] . "</td>";
				     ?>
				     <td  align="center">
					     <?php if($PERMISSION[CAN_VIEW]): $totalColumn++;?>
						 	[<a onclick="return loadbyaction('{URL}/{page}/view/' , '{page}' , '<?=$rec['id'];?>');">view</a>]
						 <?php endif;?>
						 <?php if($PERMISSION[CAN_EDIT]): $totalColumn++;?>
						 	[<a onclick="return loadbyaction('{URL}/{page}/edit/' , '{page}' , '<?=$rec['id'];?>');">edit</a>]
						 <?php endif;?>
						 <?php if($PERMISSION[CAN_DELETE]): $totalColumn++;?>
						 	[<a onclick="return deleteRecord('{URL}/{page}/ajaxdelete/<?=$rec['id']?>' , 'tr_main_{page}_details_<?=$rec['id']?>' , '{page}' , '<?=$rec['id']?>')">delete</a>]
						 <?php endif;?>
					 </td>
					<?php 
					}
					 ?>